<?php

namespace App\Http\Service;

class CommonService {

    public static function p($data = null) {
        echo '<pre>';
        print_r($data);
        echo '</pre>';
    }

    public static function pp($data = null) {
        echo '<pre>';
        print_r($data);
        echo '</pre>';
        die;
    }

    public static function dealString($string = null) {
        if (empty($string)) {
            return false;
        }
        $rr = [];
        if (mb_strlen($string) == 6) {
            $rr['first'] = mb_substr($string, 0, 2);
            $rr['second'] = mb_substr($string, 1, 2);
            $rr['third'] = mb_substr($string, 3, 2);
        }
        if (mb_strlen($string) == 12) {
            $rr['first'] = mb_substr($string, 0, 2);
            $rr['second'] = mb_substr($string, 1, 2);
            $rr['third'] = mb_substr($string, 3, 2);
            $rr['fourth'] = mb_substr($string, 5, 3);
            $rr['fifth'] = mb_substr($string, 8, 3);
        }
        return $rr;
    }

}
